using System.ComponentModel.DataAnnotations;
using SqlSugar;

namespace TradeFlow.Server.Models;

/// <summary>
/// 对账单表头信息
/// </summary>
[SugarTable(nameof(JxAccountHead), "对账单表头信息")]
public class JxAccountHead : EntityBase
{
    /// <summary>
    /// 单据类型（客户、供应商）
    /// </summary>
    [Required, MaxLength(50)]
    [SugarColumn(ColumnDescription = "单据类型")]
    public string Type { get; set; }

    /// <summary>
    /// 对账单号
    /// </summary>
    [Required, MaxLength(50)]
    [SugarColumn(ColumnDescription = "对账单号")]
    public string AccountNo { get; set; }

    /// <summary>
    /// 单证状态
    /// </summary>
    [Required, MaxLength(50)]
    [SugarColumn(ColumnDescription = "单证状态")]
    public string Status { get; set; }

    /// <summary>
    /// 对账日期
    /// </summary>
    [Required]
    [SugarColumn(ColumnDescription = "对账日期")]
    public DateTime AccountDate { get; set; }

    /// <summary>
    /// 商业伙伴
    /// </summary>
    [Required, MaxLength(100)]
    [SugarColumn(ColumnDescription = "商业伙伴")]
    public string Partner { get; set; }

    /// <summary>
    /// 业务日期
    /// </summary>
    [Required, MaxLength(100)]
    [SugarColumn(ColumnDescription = "业务日期")]
    public string BizDates { get; set; }

    /// <summary>
    /// 合同号
    /// </summary>
    [MaxLength(50)]
    [SugarColumn(ColumnDescription = "合同号", IsNullable = true)]
    public string ContractNo { get; set; }

    /// <summary>
    /// 发票号
    /// </summary>
    [MaxLength(50)]
    [SugarColumn(ColumnDescription = "发票号", IsNullable = true)]
    public string InvoiceNo { get; set; }

    /// <summary>
    /// 总金额
    /// </summary>
    [SugarColumn(ColumnDescription = "总金额", IsNullable = true, ColumnDataType = "decimal(18,2)")]
    public decimal? TotalAmount { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [SugarColumn(ColumnDescription = "备注", IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
    public string Note { get; set; }

    /// <summary>
    /// 附件
    /// </summary>
    [MaxLength(500)]
    [SugarColumn(ColumnDescription = "附件", IsNullable = true)]
    public string Files { get; set; }
}